﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
using DataService;

public partial class Billing_accountBillingContactInformation : BasePage
{
    private ContactService contactService = new ContactService();
    private Contact BillingContact;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (UserLogin != null)
        {
            BillingContact = contactService.GetBillingContact(UserLogin.Customer.Id);
            if (BillingContact != null)
            {
                MainContactSubmit.Contact = BillingContact;
            }
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        BillingContact = MainContactSubmit.Contact;
        if (UserLogin != null && BillingContact != null)
        {
            UserLogin.Customer.BillingContact = BillingContact;
            contactService.InsertUpdateBillingAddress(UserLogin.Customer.Id, BillingContact);
            Response.Redirect("default.aspx");
        }
    }
}